//============================================================================
// Name        : wings.cpp
// Author      : Benedikt Bovelette / Ingmar Hartung
// Version     :
// Copyright   : (c) 2012
// Description :
//============================================================================
#include "Header/wings.h"

static float yypoz = 0;

void animate() {
	yypoz += 2.2;
	if (yypoz > 360)
		yypoz = 0;

	glutPostRedisplay();
}

void DrawWings() {
	GLUquadricObj* cylSphere;
	cylSphere = gluNewQuadric();

	glPushMatrix();
	{
		glTranslatef(-0.13, 0.01, -0.385);
		glPushMatrix();
		{
			GLUquadricObj* cylSphere;
			cylSphere = gluNewQuadric();
			glTranslatef(1.2, 0.01, 0.5);
			glRotatef(-75, 0., 1.0, 0.);
			glRotatef(-yypoz, 0, 0, 1);
			gluCylinder(cylSphere, 0.0, 0.0, 0.0, 100, 100);

			//Leichtgrau
			glPushMatrix();
			{
				glRotatef(0, 1, 0, 0);
				glTranslatef(0.0, 0.35, 0);
				glColor3f(.6, .6, .6);
				glScalef(0.4, 2.6, 0.2);
				initMaterial(1);
				gluSphere(cylSphere, .15, 100, 100);
			}
			glPopMatrix();
//			//Leichtgrau
			glPushMatrix();
			{
				glRotatef(60, 0, 0, 1);
				glTranslatef(0.0, -0.35, 0);
				glColor3f(.6, .6, .6);
				glScalef(0.4, 2.6, 0.2);
				initMaterial(1);
				gluSphere(cylSphere, .15, 100, 100);
			}
			glPopMatrix();
//			//Leichtgrau
			glPushMatrix();
			{
				glRotatef(-60, 0, 0, 1);
				glTranslatef(0.0, -0.35, 0);
				glColor3f(.6, .6, .6);
				glScalef(0.4, 2.6, 0.2);
				initMaterial(4);
				gluSphere(cylSphere, .15, 100, 100);
			}
			glPopMatrix();
		}
		glPopMatrix();
		Sleep(5);
	}
	glPopMatrix();

}
